package sockety.client.add;

import java.io.InputStream;
import java.util.Scanner;

public class InputScannerExt extends InputScanner {
	
	private Scanner scan;
	
	public InputScannerExt(InputStream is, OnDataReceived listener) {
		super(is, listener);
		scan = new Scanner(is);
	}
	
	@Override
	public void run() {
		
		while(run){
			String line = scan.nextLine();
			if(listener != null){
				listener.received(line);
			}
			else{
				System.out.println(line);
			}
		}
	}
}
